package preanalisis;

import grafo.keyWord;

import javax.mail.internet.*;
import javax.mail.search.BodyTerm;
import javax.mail.search.SearchTerm;
import javax.mail.*;
import javax.mail.Flags.Flag;
import java.io.*;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;

import javax.activation.*;

import com.sun.mail.imap.IMAPFolder;

public class Preanalisis {

	public static String cadenadepreanalisis = "";
	private static File archivo = null;
	private static FileReader fr = null;
	private static BufferedReader br = null;

	public static ArrayList<String> preanalisis(String tal) throws IOException {

		String UltimoCorreo[] = tal.split(" ");

		archivo = new File("palabrasClave.liam");

		fr = new FileReader(archivo);
		br = new BufferedReader(fr);
		ArrayList<String> palabrasanalisadas = new ArrayList<String>();

		for (int i = 0; i < UltimoCorreo.length; i++) {

			if (UltimoCorreo[i].equalsIgnoreCase(br.readLine()))
				palabrasanalisadas.add(new String(UltimoCorreo[i]));

		}
		return palabrasanalisadas;
	}
}
